<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			function checkForm(f){
				var e=f.email.value;
				if(e.indexOf('@')<1){
					alert("邮件格式非法");
					return false;
				}
				var p=f.pass.value;
				if(p.length<6||p.length>10){
					alert("密码长度不合适");
					return false;
				}
				return true;
			}
		</script>
	</head>
	<body>
		<form action="2.html" onsubmit="return checkForm(this)">
			<p>
				email:<input type="text" name="email" />
			</p>
			<p>
				密码:<input type="password" name="pass" />
			</p>
			<input type="submit" />
		</form>
	</body>
</html>
